package main

import (
	"fmt"
	"log"

	"github.com/garyburd/redigo/redis"
)

func main() {
	con, err := redis.Dial("tcp", "1.15.136.124:6379", redis.DialPassword("liu15332"))
	if err != nil {
		log.Panic("open redis error!")
	}
	defer con.Close()
	_, err = con.Do("HMSet", "user01", "name", "sam", "age", 18)
	if err != nil {
		log.Println(err)
		log.Panic("do error!")
	}
	r, err := redis.String(con.Do("HMGet", "user01"))
	if err != nil {
		log.Panicln(err)
		log.Panic("get error!")
	}
	fmt.Println(r)
}
